package com.xiaolong.redis.util;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.reflect.MethodSignature;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;

public class PointUtil {

    public static <T extends Annotation> T getInstance(ProceedingJoinPoint point, Class<T> tClass) {
        MethodSignature signature = (MethodSignature) point.getSignature();
        Method method = signature.getMethod();
        return method.getAnnotation(tClass);
    }
}
